#!/bin/bash

DIANA_HOME=/home/dgorea

add_to_path(){
	  if [ -d $1 ] ; then
      if [ $PATH ] ; then
	PATH=$1:"${PATH}"
      else
	PATH=$1
      fi
    fi
	export PATH
}

add_to_library_path () {
    if [ -d $1 ] ; then
      if [ $LD_LIBRARY_PATH ] ; then
	LD_LIBRARY_PATH=$1:"${LD_LIBRARY_PATH}"
      else
	LD_LIBRARY_PATH=$1
      fi
    fi
    export LD_LIBRARY_PATH
}

module load mpitb openmpi/gnu

#octave_config=${DIANA_HOME}/octave/bin/octave-config

# octave_config=/usr/bin/octave-config
# if [ -f $octave_config ]; then
#	OCTBIN=`$octave_config --print BINDIR`
#	OCTAVE=`$octave_config --print PREFIX`
#	add_to_path ${OCTBIN}
#	export MPITB_HOME=${OCTAVE}/mpitb
# fi

alias octave='octave -q'

mpirun -np 5 --mca  orte_base_help_aggregate 0 --mca mpi_warn_on_fork 0  octave --eval runDreamMasterSlave
